@echo off
set PWD=%~dp0
cd /d %PWD%
cd ..

REM ================================================
REM 当前用户注册 .tlvprj 扩展名到 TlvTool.exe
REM 无需管理员权限
REM ================================================

set APP_PATH=%cd%\TlvTool.exe
set ICON_PATH=%cd%\icons\icon1.ico

REM 关联 .tlvprj 到 TlvTool.Project
reg add "HKCU\Software\Classes\.tlvprj" /ve /d "TlvTool.Project" /f

REM 创建描述
reg add "HKCU\Software\Classes\TlvTool.Project" /ve /d "TlvTool Project File" /f

REM 设置打开命令
reg add "HKCU\Software\Classes\TlvTool.Project\shell\open\command" /ve /d "\"%APP_PATH%\" \"%%1\"" /f

REM 设置图标（可选）
reg add "HKCU\Software\Classes\TlvTool.Project\DefaultIcon" /ve /d "%ICON_PATH%,0" /f

echo .tlvprj is now associated with TlvTool.exe

